/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package api.user;

import Model.User.UserList;
import RssEasy.Core.HttpRequestHelper;
import RssEasy.Core.ServletRequestHelper;
import RssEasy.Core.SignVerifyRequestHelper;
import java.io.IOException;
import java.io.PrintWriter;
import javax.security.auth.login.AccountException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author admin
 */
@WebServlet(name = "login_select", urlPatterns = {"/api/login/select"})
public class select extends ServletRequestHelper {

    @Override
    protected HttpRequestHelper request(HttpServletRequest request, HttpServletResponse response) {
        super.request(request, response);
        try {
            UserList list = new UserList(this.pageContext);
           list.select("enterprise,account,myid").where("account='"+this.get("account")+"'").get_first_rows();
            //out.print(list.select("enterprise,account,myid").where("account='"+this.get("account")+"'").sql);
           // list.query("select enterprise,account,myid from user_list where account='"+this.get("account")+"'");
            out.print(list.toKeyValue());
        } catch (Exception e) {
            out.print("{\"rsscode\":" + e.getMessage() + "}");
        }
        return this;
    }

}
